<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>get请求</title>
	</head>
	<script src='jquery.js'></script>
	<body>
		
		
		<form action="index.html">
			<input type="text" name="uname" /><br />
			<input type="password" name="password" /><br />
			<input type="submit" value="登录"/>
		</form>
		
	</body>
	
	<script>
		
		//ajax:Asynchronous JavaScript and XML
//			异步的JS与XML
//		再不重载页面的条件下更新页面数据

	
		$('form').submit(function(eve){
			
			eve.preventDefault();
			console.log('已经阻止');
			var data = $(this).serialize();
//			获取表单数,自动转换成字符串序列化对
			console.log(data)
			$.post('/index.html',data,function(resData){
				
				
				
				//请求成功的回调函数
				//resData是响应数据
				
			})
			
			
			
		})
		
		
	</script>
	
</html>
